local ToggleOnNextStrike = ToggleOnNextStrike_Get_Instance();

local DEFAULTS = {
	mode = false;
};


function ToggleOnNextStrike:SettingsInit()
	self.setup.frame = CreateFrame("Frame");
	self.setup.frame:SetScript("OnEvent", function() local f = self[event] if type(f) == "function" then f(self) end end);
	self.setup.frame:RegisterEvent("ADDON_LOADED");
end

function ToggleOnNextStrike:ADDON_LOADED()
	if ( arg1 == "ToggleOnNextStrike" ) then	
		-- Perform stuff that requires variable initialization here.
		if type(ToggleOnNextStrike_SettingsPerChar) ~= "table" then
			ToggleOnNextStrike_SettingsPerChar = {}
		end
	end
end




function ToggleOnNextStrike:GetSetting(setting)
	if type(setting) == "nil" then
		return
	end
	local value = nil
	if type(ToggleOnNextStrike_SettingsPerChar) == "table" then
		value = ToggleOnNextStrike_SettingsPerChar[setting]
	end
	if value == nil then
		value = DEFAULTS[setting]
	end
	return value
end

function ToggleOnNextStrike:SetSetting(setting, value)
	if type(setting) == "nil" then
		return
	end
	if type(ToggleOnNextStrike_SettingsPerChar) ~= "table" then
		ToggleOnNextStrike_SettingsPerChar = {};
	end
	ToggleOnNextStrike_SettingsPerChar[setting] = value
end

function ToggleOnNextStrike:GetMode()
	return self:GetSetting("mode")
end

function ToggleOnNextStrike:SetMode(newMode)
	if newMode then
		self:SetSetting("mode", true)
	else
		self:SetSetting("mode", false)
	end
end

ToggleOnNextStrike:SettingsInit();

